﻿@using MsForgeReboot.Web.Extensions
@using MsForgeReboot.Framework.Entities
@using PagedList

@model IPagedList<Speaker>

<h2>@ViewBag.Title</h2>
<p>
    @Html.ActionLink("Dodaj novog predavača", "Create", null, new { @class = "btn btn-primary" })
</p>

@Html.Partial("_PagedView", Model)
<ul>
    @foreach (var item in Model) {
        <li>
            <div class="speaker-listItem">
                <h3>@Html.ActionLink(item.FullName, "Edit", new { urlPointer = item.UrlPointer })</h3>   
                <p class="btn-group">
                    @Html.ActionLink("Edit", "Edit", new { Area = "ControlPanel", id = item.UrlPointer }, new { @class = "btn btn-small" }) | 
                    @Html.ActionLink("Delete", "Delete", new { Area = "ControlPanel", id = item.UrlPointer }, new { name = "DeleteLink", @class = "btn btn-danger btn-small" })
                </p>
                <div>
                    @if (string.IsNullOrEmpty(item.PicturePath)) {
                        <img src="~/Content/MediaGallery/Speakers/Thumbnails/silhouette.png" alt="@item.FullName"/>
                    }
                    else {
                        <img src="@Url.Content(string.Format("~/Content/MediaGallery/Speakers/Thumbnails/{0}", item.PicturePath))" alt="@item.FullName"/>
                    }
                </div>
                <div>
                    <p>@Html.DisplaySummaryFor(item.Biography) @Html.ActionLink("...", "Edit", new { urlPointer = item.UrlPointer })</p>
                </div>
            </div>
        </li>
    }
</ul>
@Html.Partial("_PagedView", Model)

<script>
    @section Scripts {
    @Scripts.Render("~/bundles/controlpanel/speakers/index")
}</script>
